﻿<%@ WebHandler Language="C#" Class="AlbumAddEdit" %>

using System;
using System.Web;
using System.Web.SessionState;

public class AlbumAddEdit : IHttpHandler, IRequiresSessionState
{
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        string status = "-1";
        try
        {
            /* 安全性验证 */
            if (Admins.IsLogin(true))
            {
                /* 接受文件处理 */
                int item_id = Convert.ToInt32(context.Request.Params["Item_Id"].ToString());
                int orders = Convert.ToInt32(context.Request.Params["Orders"].ToString());
                int item_column = Convert.ToInt32(context.Request.Params["Item_Typ"].ToString());
                int item_lang = Convert.ToInt32(context.Request.Params["Item_lang"].ToString());
                string item_title = context.Request.Params["Item_Title"].ToString();
                string item_content = context.Request.Params["Item_Content"].ToString();
                DateTime create_time = Convert.ToDateTime(context.Request.Params["create_time"].ToString());
                string fileExt = context.Request.Params["Item_fileExt"].ToString();

                Album album = new Album();
                status = album.Album_AddEdit(item_id, orders, item_column, item_title, item_content, create_time, item_lang, fileExt);
                /* 返回执行结果 */
                Utils.ShowEnd(context, status);
                
            }
        }
        catch (Exception ex)
        {
            status = ex.ToString();
        }
        


    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}